//1379.找出克隆二叉树中的相同节点
//https://leetcode.cn/problems/find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/
class Solution {
public:
    TreeNode* getTargetCopy(TreeNode* original, TreeNode* cloned, TreeNode* target) {
        if(original == nullptr || cloned == nullptr) return nullptr;
        if(original == target && cloned->val == target->val) return cloned;
        TreeNode* l = getTargetCopy(original->left,cloned->left,target);
        TreeNode* r = getTargetCopy(original->right,cloned->right,target);
        if(l) return l;
        return r;
    }
};